package com.kevin.wiki.util;

import org.apache.tomcat.util.codec.binary.Base64;

/**
 * @author kevin.lv
 * @date 2022/3/3 9:50
 */
public class BasicTest {


    public static void main(String[] args) {
        String auth = "quectel:quectel_logistics";
        byte[] encodedAuth = Base64.encodeBase64(auth.getBytes());
        String authHeader = "Basic " + new String(encodedAuth);
        System.out.println(authHeader);
        String authRequest = "";
        authRequest = authHeader.replaceAll("Basic ", "");
        System.out.println(authRequest);
        byte[] bytes = authRequest.getBytes();
        byte[] decodeAuth = Base64.decodeBase64(bytes);
        String result = new String(decodeAuth);
        System.out.println(result);

    }

}
